package com.aaa.sso.factory;

import com.aaa.entity.User;
import com.aaa.sso.feign.UserFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @program: aaa-his-parent
 * @description:
 * @author: 闫克起2
 * @create: 2023-12-07 11:44
 **/
@Component
@Slf4j
public class MyUserFallbackFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public User selectUserByPhone(String phone) {
                log.error("系统微服务故障............");
                return null;
            }
        };
    }
}
